{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f2e2b2d2-67a1-4346-bfa3-73f5b286b0ac",
   "metadata": {},
   "source": [
    "# Faceted Time Series using Groupby\n",
    "\n",
    "A multi-dimensional plot showing how air temperature changes over time. This example uses the `groupby` option with an xarray Dataset to explore values interactively."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2d0d8b47-bf26-49ae-a2c7-6777b62b0377",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hvplot.xarray  # noqa\n",
    "\n",
    "ds = hvplot.sampledata.air_temperature('xarray').isel(time=slice(0, 3))\n",
    "\n",
    "ds.hvplot.image(\n",
    "    x='lon',\n",
    "    y='lat',\n",
    "    cmap='coolwarm',\n",
    "    groupby='time',\n",
    "    frame_width=400,\n",
    "    dynamic=False,\n",
    "    framewise=False,\n",
    "    title='Air Temperature Over Time (Bokeh)',\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fcfea113-e8f1-497f-8f38-4710c35bcfab",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hvplot.xarray  # noqa\n",
    "hvplot.extension('matplotlib')\n",
    "\n",
    "ds = hvplot.sampledata.air_temperature('xarray').isel(time=slice(0, 3))\n",
    "\n",
    "ds.hvplot.image(\n",
    "    x='lon',\n",
    "    y='lat',\n",
    "    cmap='coolwarm',\n",
    "    groupby='time',\n",
    "    frame_width=400,\n",
    "    dynamic=False,\n",
    "    framewise=False,\n",
    "    title='Air Temperature Over Time (Matplotlib)',\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "957dee20-536c-490a-ab6d-84e6dee7dca7",
   "metadata": {},
   "source": [
    ":::{seealso}\n",
    "- [Image reference documentation](../../ref/api/manual/hvplot.hvPlot.image.ipynb)\n",
    "- [Groupby option](option-groupby)\n",
    ":::"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
